﻿<UserControl x:Class="ModernAudioTagger.Content.ContentMedia"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:mui="http://firstfloorsoftware.com/ModernUI"
             xmlns:mscorlib="clr-namespace:System;assembly=mscorlib"
             xmlns:provider="clr-namespace:ModernAudioTagger.Provider"
             xmlns:vm="clr-namespace:ModernAudioTagger.ViewModel"
             xmlns:helper="clr-namespace:ModernAudioTagger.Helpers"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="500">

    <UserControl.DataContext>
        <Binding Source="{x:Static provider:ViewModelLocator.Instance}" Path="MediaVM" />
    </UserControl.DataContext>

    <UserControl.Resources>
        <ObjectDataProvider 
                    x:Key="openMediaModeItems"
                    ObjectType="{x:Type mscorlib:Enum}" 
                    MethodName="GetValues">
            <ObjectDataProvider.MethodParameters>
                <x:TypeExtension Type="{x:Type vm:MediaViewModel+OPEN_MEDIA_MODE}" />
                <!--<x:TypeExtension TypeName="vm:MediaViewModel+OPEN_MEDIA_MODE" />-->
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>
    </UserControl.Resources>

    <DockPanel>

        <StackPanel>
            <TextBlock Style="{StaticResource Heading2}">OPEN AUDIO FILE MODE</TextBlock>
            <ComboBox Margin="{StaticResource DefaultTopMargin}" 
                      ItemsSource="{Binding Source={StaticResource openMediaModeItems}}"
                      SelectedItem="{Binding OpenMediaMode}"
                      >
            </ComboBox>

            <GroupBox Margin="{StaticResource DefaultTopMargin}" Header="EXTERNAL APPLICATION">
                <!--<GroupBox.Style>
                    <Style TargetType="{x:Type GroupBox}" BasedOn="{StaticResource {x:Type GroupBox}}">
                        <Setter Property="IsEnabled" Value="False"></Setter>
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding OpenMediaMode}" Value="EXTERNAL">
                                <Setter Property="IsEnabled" Value="True"></Setter>
                            </DataTrigger>
                        </Style.Triggers>                        
                    </Style>
                </GroupBox.Style>-->
                <StackPanel>
                    <TextBlock Style="{StaticResource Heading2}" Margin="{StaticResource DefaultTopMargin}">APPLICATION PATH</TextBlock>
                    <Grid Margin="{StaticResource DefaultTopMargin}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="80*"></ColumnDefinition>
                            <ColumnDefinition Width="20*"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBox Text="{Binding ExternalApplicationPath}" IsReadOnly="True" Margin="{StaticResource DefaultTopMargin}"></TextBox>
                        <Button Margin="{StaticResource DefaultTopLeftMargin}" Width="50" Command="{Binding OpenExternalApplicationCommand}" Content=".." Grid.Column="1"></Button>
                    </Grid>
                    <TextBlock Style="{StaticResource Heading2}" Margin="{StaticResource DefaultTopMargin}">ARGUMENTS (%f for selected file)</TextBlock>
                    <TextBox Margin="{StaticResource DefaultTopMargin}" Text="{Binding CommandArguments}"></TextBox>
                </StackPanel>
            </GroupBox>
        </StackPanel>

    </DockPanel>

</UserControl>
